<?php
/*
Plugin Name: fusion 
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
Description: articles translation by bing engin
Version: 1.0
Author: Mr.suksawat
Author URI: http://www.poonim.com
*/

if (version_compare(PHP_VERSION, '5.0.0.', '<'))
{
    die("Requires php 5 or a greater version to work.");
}


//register_deactivation_hook(__FILE__, 'unitranslator_deactivate'); 
//add_filter('content_save_pre','content_replare');
//add_filter('excerpt_save_pre','content_replare'); 
add_action( 'admin_init', 'fusion_update_form' );
if ( is_admin() ){ // admin actions
        register_activation_hook( __FILE__, 'fusion_activate' );
        add_action('admin_menu', 'init_menu');
      
 
 			
    } 

function init_menu()
{
	
		add_submenu_page('post-new.php', __('youtube'), __('youtube video'), '4', 'youtube_form', 'youtube_form');
}
  
function youtube_form()
{
	
	?>
	
	<div><form action="#" method="post"> 
	<input type="text" style="width: 400px;" name="url" value="<?php echo get_option("youtube_url") ?>"/><br/>
	<input type="submit" value="Save" />
	<input type="hidden" name="action" value="saveyoutube" /> 
	</form></div>
	
	<?php 
}

function fusion_activate()
{
	
	    add_option("youtube_url","");
}
function fusion_update_form()
{
	if($_POST['action']=="saveyoutube"){
		
		update_option("youtube_url",$_POST['url']);
	}
}

?>